package sng.modules.view.components.city.logic.unit
{
	import flash.events.Event;
	
	import sng.modules.view.components.city.logic.CityView;
	
	public class OperateBar extends Tile
	{
		private var view:CityView;
		private var bar:AttachmentProgreass;
		private var funcArray:Array; //进度条完成后的调用函数数组
		
		public function OperateBar(_view:CityView, _type:String, _callbackFuncArray:Array)
		{
			view = _view;
			funcArray = _callbackFuncArray;
			
			bar = new AttachmentProgreass();
			this.sprites.push(bar);
			invalidateSprites();
			
			bar.scaleX = bar.scaleY = (1/_view.currentZoom);
			
			bar.addEventListener("progressOver", progressOver);
		}
		
		protected function progressOver(event:Event):void
		{
			for(var i:int=0;i<funcArray.length;i++)
			{
				var f:Function = funcArray[i] as Function;
				f();
			}
		}
	}
}